﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace BawangMemo.BawangMemoView
{
    public class ViewUtil
    {
        internal static bool IsNotNullOrEmpty(string s)
        {
            return s != null && !s.Equals(String.Empty);
        }

        /// <summary>
        /// 字符串模式：只包含中文，英文，数字和下划线
        /// </summary>
        public const string VALID_COURSE_NAME_PATTERN = @"^[\u4e00-\u9fa5a-zA-Z0-9_]+$";

        internal static bool IsValidCourseName(string name)
        {
            return Regex.IsMatch(name, VALID_COURSE_NAME_PATTERN);
        }
    }
}
